<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <script>
        const numberss = [1, 3, 5, 7, 9, 2, 4, 6, 8, 10]
        console.log("原始数组：",numberss)
        const filtered = numberss.filter((num) => {
            return num > 5
        });
        console.log("大于5的数字:", filtered)

        const numbers1 = [5, 2, 8, 1, 9, 3]
        const filtered1 = numbers1.filter((number, index, array) => {
            console.log("当前元素:" +number+"索引:" +index+"原数组:" +array)
        })

        const numberStrings = numberss.map(a => a + "大于5吗？" + (a > 5))
        console.log("转换后的数组:", numberStrings)
        let fruits = ['apple', 'banana'];
fruits.push('orange'); 
console.log(fruits.push('orange'))
console.log(fruits.push(''))
let lastItem = fruits.pop(); 
console.log(lastItem)
let firstItem = fruits.shift(); 
console.log(firstItem)
fruits.unshift('grape'); 
console.log(fruits.unshift('grape'))
let numbers = [1, 2, 3];
let doubled = numbers.map(x => x * 2); 

let filtereds = numbers.filter(x => x > 1); 
console.log(filtereds)
let sum = numbers.reduce((total, num) => total + num, 0);
let passed = numbers.some(x => x > 2); 
let allPassed = numbers.every(x => x > 0);  
let found = numbers.find(x => x > 2);  
console.log(found)
numbers.forEach(num => console.log(num));  

    </script>
</body>
</html>